import request from '@/utils/request'

// 创建机种信息
export function createModelInfo(data) {
  return request({
    url: '/lamp/model-info/create',
    method: 'post',
    data: data
  })
}

// 更新机种信息
export function updateModelInfo(data) {
  return request({
    url: '/lamp/model-info/update',
    method: 'put',
    data: data
  })
}

// 删除机种信息
export function deleteModelInfo(id) {
  return request({
    url: '/lamp/model-info/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除机种信息 */
export function deleteModelInfoList(ids) {
  return request({
    url: `/lamp/model-info/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得机种信息
export function getModelInfo(id) {
  return request({
    url: '/lamp/model-info/get?id=' + id,
    method: 'get'
  })
}

// 获得机种信息分页
export function getModelInfoPage(params) {
  return request({
    url: '/lamp/model-info/page',
    method: 'get',
    params
  })
}
// 导出机种信息 Excel
export function exportModelInfoExcel(params) {
  return request({
    url: '/lamp/model-info/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}